//package com.t01.bdqn.mapper.impl;
//
//import com.t01.bdqn.entity.ComputerRoom;
//import com.t01.bdqn.entity.dto.ComputerRoomQuery;
//import com.t01.bdqn.mapper.ComputerRoomMapper;
//import org.apache.ibatis.io.Resources;
//import org.apache.ibatis.session.SqlSession;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.apache.ibatis.session.SqlSessionFactoryBuilder;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//import java.io.InputStream;
//import java.util.List;
//
//
//@Component("computerRoomMapper")
//public class ComputerRoomMapperImpl implements ComputerRoomMapper {
//    public ComputerRoomMapperImpl() {
//        System.out.println("ComputerRoomMapperImpl 被创建");
//    }
//
//    @Override
//    public List<ComputerRoom> ComputerSet(int pageNo, int count) throws IOException {
//
//        String resource = "mybatis-config.xml";
//        InputStream inputStream = Resources.getResourceAsStream(resource);
//        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
//
//        try(SqlSession session = sqlSessionFactory.openSession()){
//            ComputerRoomMapper mapper = session.getMapper(ComputerRoomMapper.class);
//            return mapper.ComputerSet(pageNo,count);
//        }
//    }
//
//    @Override
//    public List<ComputerRoom> ComputerSetByQuery(ComputerRoomQuery computerRoomQuery) throws IOException {
//
//        String resource = "mybatis-config.xml";
//        InputStream inputStream = Resources.getResourceAsStream(resource);
//        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
//
//        try(SqlSession session = sqlSessionFactory.openSession()){
//            ComputerRoomMapper mapper = session.getMapper(ComputerRoomMapper.class);
//            return mapper.ComputerSetByQuery(computerRoomQuery);
//        }
//    }
//}
